{template 'common/header'}

{template 'common'}

<div class="main">

	<ul class="nav nav-tabs">

		<li{if $_GPC['do'] == 'manage'} class="active"{/if}><a href="{php echo $this->createWebUrl('manage');}">兑奖管理</a></li>

		<li{if $_GPC['do'] == 'post'} class="active"{/if}><a href="{php echo url('platform/reply/post',array('m'=>'laoyou_csyx'));}">添加规则</a></li>

		<li{if $_GPC['do'] == 'awardlist'} class="active"{/if}><a href="{php echo $this->createWebUrl('awardlist',array('name'=>'laoyou_csyx', 'rid' => $rid));}">中奖名单</a></li>

	</ul>

    <div class="panel panel-info">

	<!-- <div class="panel-heading">筛选</div>

	<div class="panel-body">

		<form action="{php echo create_url('site', array('do' => 'awardlist', 'name' => 'laoyou_csyx','rid'=>$rid))}" method="get" class="form-horizontal" role="form">

			<input type="hidden" name="c" value="site" />

			<input type="hidden" name="a" value="entry" />

        	<input type="hidden" name="m" value="ewei_scratch" />

        	<input type="hidden" name="do" value="awardlist" />

        	<input type="hidden" name="rid" value="{$_GPC['rid']}" />

			<div class="form-group">

				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>

				<div class="col-xs-12 col-sm-8 col-lg-9">

					<input class="form-control" name="keywords" id="" type="text" value="{$_GPC['keywords']}" placeholder="可查询SN码"> 

				</div>

			</div>

			<div class="form-group">

				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>

				<div class="col-xs-12 col-sm-8 col-lg-9">

					<select name="status" class="form-control" style="float:left">

                    	<option value="" {if $_GPC['status']==''}selected{/if}>全部</option>

                        <option value="1" {if $_GPC['status']=='1'}selected{/if}>未兑换</option>

                        <option value="2" {if $_GPC['status']=='2'}selected{/if}>已兑换</option>

                	</select>

				</div>

                <div class=" col-xs-12 col-sm-2 col-lg-2">

					<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>

				</div>

			</div>

		</form>

	</div> -->

</div>

<div class="panel panel-default">

<div class="panel-heading">

	<div class="alert" style="margin-bottom:0;">

		<!-- 本次活动奖品总数：{$num1}个　-->参与人数:{$num}人

	</div>

</div>

	<div style="position:relative">

		<div class="panel-body table-responsive">

			<table class="table table-hover" style="position:relative">

			<thead class="navbar-inner">

				<tr>
					<th class='with-checkbox' style="width:50px;">
						<input type="checkbox" class="check_all" />
					</th>

					<th width="200px">微信号</th>
					
					<th width="200px">当前抽奖次数（隔日清零）</th>
					
					<th width="200px">参与时间</th>

				</tr>

			</thead>

			<tbody>

				{loop $list $row}

				<tr>
					<td class="with-checkbox">
						<input type="checkbox" name="check" value="{$row['id']}">
					</td>

					<td>{$row['openid']}</td>
					
					<td>{$row['num']}</td>
					
					<td>{php echo date('Y-m-d H:i',$row['addtime'])}</td>

				</tr>


				{/loop}
				<tr>

					<td colspan="7">

						<input type="button" class="btn btn-primary" name="deleteaa" value="删除选择的" />

					</td>

				</tr>

			</tbody>

		</table>

	</div>

</div>

</div>

{$pager}

</div>
<script>
$(function(){
    $(".check_all").click(function(){
       var checked = $(this).get(0).checked;
		$(':checkbox').each(function(){this.checked = checked});
    });
	$("input[name=deleteaa]").click(function(){
 
		var check = $("input:checked");
		if(check.length<1){
			err('请选择要删除的记录!');
			return false;
		}
        if( confirm("确认要删除选择的记录?")){
		var id = new Array();
		check.each(function(i){
			id[i] = $(this).val();
		});
		$.post('{php echo $this->createWebUrl('deleteaa')}', {idArr:id},function(data){
			if (data.type ==0)
			{
				alert('删除成功！');
				location.reload();
			} else {
				alert(data.error);
			}
 

		},'json');
		}

	});
});
</script>
<script>

$(".phone").click(function() {

	$(".phone").addClass('label-teal');

	$(".phone").text('显示手机号');

	obj=$(this);

	obj.text('加载中...');

	fans=obj.attr('data-fans');

	$.post("{php echo $this->createWebUrl('getphone',array('rid'=>$rid))}", { fans: fans},

	function(data){

		obj.removeClass('label-teal');

		obj.text(data);

	});



});

	function drop_confirm(msg, url){

    if(confirm(msg)){

        window.location = url;

    }

}

</script>

{template 'common/footer'}